package com.swipemaster.common;

import android.app.Application;

import com.bugsense.trace.BugSenseHandler;
import com.google.analytics.tracking.android.EasyTracker;
import com.swipemaster.dialogs.GameDialog;
import com.swipemaster.game.GameSurface;
import com.swipemaster.game.modes.GameMode;
import com.swipemaster.music.MusicPlayer;

public class Global extends Application
{
	/** Global context of the application. Can be used to obtain resources, write/read to file in convenient way. Should
	 * not be used to display dialogs! Dialogs must be displayed on the current (visible) Activity. */
	public static Global app;

	/** Debugging flag, should be false in the production code. */
	public static final boolean DEBUG = false;

	public Const consts;
	public Prefs prefs;
	public MusicPlayer musicPlayer;

	/** Are we during a gameplay? During a gameplay thread can run on not, it doesn't matter. Gameplay is from clicking
	 * start button till the end. */
	public boolean isDuringGameplay;
	public GameSurface gameSurface;
	public GameMode gameMode;
	public GameDialog dialog;
	
	public final AdMobListener adMobListener = new AdMobListener();

	@Override
	public void onCreate()
	{
		super.onCreate();
		app = this;
		consts = new Const();
		prefs = new Prefs();
		musicPlayer = new MusicPlayer();
		BugSenseHandler.initAndStartSession(this, "5b71a179");
		EasyTracker.getInstance().setContext(app);
	}
}
